<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
<?php echo $cabecalho; ?>
<?php echo $menu_esq; ?>
<div id="mainContent">
<h1>Editar Usuarios</h1>
<div><?php echo $msg;?></div>
<p>
<?php echo form::open("user/salvar"); ?>
<table width="100%" border="1">
      <tr>
        <td>nome</td>
        <td>valor</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <?php foreach($users as $user){?>
      <?php echo form::hidden('id[]', $user->id)?>
	  <tr>
        <td>username</td>
        <td><?php echo form::input("username[]", $user->username); ?></td>
      </tr>
      <tr>
        <td>Usuario Ativo</td>
        <td><?php echo form::checkbox("active[]", '1', $user->active); ?></td>
      </tr>
      <tr>
        <td>Roles</td>
        <td><?php echo form::dropdown('roles[]', $roles, $user->auth_roles[0]); ?></td>
      </tr>
      <tr>
        <td>Senha</td>
        <td><?php echo html::anchor('user/editar_senha/'.$user->id, 'Trocar Senha'); ?></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <?php }?>
      <tr>
        <td><?php echo form::submit('enviar', 'Editar')?>&nbsp;</td>
        <td><?php echo html::anchor('user/listar/', 'Voltar'); ?>&nbsp;</td>
      </tr>
    </table>
<?php echo form::hidden('acao', 'editar'); ?>
<?php echo form::close(); ?>
</p>
<!-- end #mainContent --></div>
<?php echo $rodape; ?>